FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9

# poetry安装包时不创建虚拟机
#ENV POETRY_VIRTUALENVS_CREATE=false
# 使用 poetry 管理依赖包时需下载
# RUN pip3 install poetry -i https://pypi.tuna.tsinghua.edu.cn/simple # 我是用了poetry管理环境，所以要单独安装这个

WORKDIR /sql_app

COPY ./requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple pillow

#COPY ./sql_app /sql_app/

COPY ./* /sql_app/
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]


#RUN mkdir -p /app
#WORKDIR /app
# 使用 poetry 时需要
# COPY pyproject.toml poetry.lock /app/
# 使用 requirements.txt
#RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple pillow
#
#COPY ./* /app

#MAINTAINER 1287195472@qq.com
